package com.ubivelox.uienginesample;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Bitmap.Config;
import android.util.AttributeSet;
import android.widget.FrameLayout;

public class MyLayout extends FrameLayout {
	private Canvas mCanvas = null;
	private Bitmap mBitmap = null;
	private Rect	mRect	= null;
	private Paint	mPaint	= null;
		
	public MyLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		mBitmap = Bitmap.createBitmap( 128, 128, Config.ARGB_8888);
		mCanvas = new Canvas( mBitmap );
		mRect	= new Rect( 0, 0, 128, 128 );
		mPaint	= new Paint();
	}


	//=============================================================================================
	@Override
	protected void dispatchDraw(Canvas canvas) {
		mCanvas.drawRect(mRect, mPaint);
		super.dispatchDraw(mCanvas);
		((UIEngineSampleTest)getContext()).CopyDraw(mBitmap);
	}
	//=============================================================================================
}
